package com.yingma.common.controller;


import com.yingma.common.util.AjaxResult;
import com.yingma.system.entity.JcSysOrganization;
import com.yingma.system.service.JcSysOrganizationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (JcSysOrganization)表控制层
 *
 * @author makejava
 * @since 2020-03-30 15:27:31
 */
@RestController
@RequestMapping("jcSysOrganization")
public class JcSysOrganizationController {
    /**
     * 服务对象
     */
    @Resource
    private JcSysOrganizationService jcSysOrganizationService;

    /**
     * 查询组织机构名称
     * @return
     */
    @RequestMapping(value = "search",method = RequestMethod.GET)
    public AjaxResult queryforName(){
        return AjaxResult.success(jcSysOrganizationService.queryName());
    }

    @ApiOperation("根据条件查询组织机构")
    @PostMapping("searchbycondition")
    public AjaxResult queryByCondition(String code, Integer pageNum, Integer pageSize){
        List<JcSysOrganization> list= jcSysOrganizationService.queryByCondition(code, pageNum, pageSize);
        return AjaxResult.success(list);
    }






}
